Skip to content

ci: scope down GitHub Token permissions#726

Closed
AdnaneKhan wants to merge 1 commit intoaws-observability:mainfrom
AdnaneKhan:update/scopedown-token
Closed

ci: scope down GitHub Token permissions#726
AdnaneKhan wants to merge 1 commit intoaws-observability:mainfrom
AdnaneKhan:update/scopedown-token

Conversation

@AdnaneKhan
Copy link
Copy Markdown
Contributor

Scope Down GitHub Token Permissions

This PR updates GitHub Actions workflows to use minimal required permissions instead of the default elevated permissions.

Why This Matters

Following the principle of least privilege, workflows should only have the specific permissions they need to function.

Changes

This PR adds explicit permissions: blocks to workflows that currently rely on default permissions, scoping them down to only what's required for their operations.

Please review the changes to ensure the specified permissions match your workflow requirements.

@AdnaneKhan AdnaneKhan marked this pull request as ready for review December 11, 2025 23:19
@williazz williazz self-requested a review December 12, 2025 00:55
Copy link
Copy Markdown
Collaborator

@williazz williazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you check the linting please?

Run npx prettier --check .
Checking formatting...
[warn] .github/workflows/codeql-analysis.yml
[warn] Code style issues found in the above file. Forgot to run Prettier?
Error: Process completed with exit code 1.

branches: [main]

permissions:
security-events: write
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: are we removing read permissions by only allowing security-events: write?

Copy link
Copy Markdown
Contributor Author

@AdnaneKhan AdnaneKhan Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For public repositories read permissions on the GitHub Token are not required because the endpoints work without any AuthN/AuthZ, with the exception of unique keys like models: read (for AI inference with GitHub models) and packages: read (for workflows that run container jobs).

@williazz williazz closed this Jan 17, 2026
@williazz williazz reopened this Jan 29, 2026
@williazz williazz closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants